<style lang="scss" >
#cmain {
    .mainContent {
        min-height: 425px;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0px 0px 15px 0px rgba(207, 207, 207, 1);
        padding-top: 10px;
        padding: 0px 30px;
        .mainContentLeft {
            float: left;
            width: 35%;
            margin-left: 10%;
        }
        .mainContentRight {
            float: right;
            width: 35%;
            margin-left: 5%;
        }
        .clearfix span {
            left: 290px;
            top: 132px;
            width: 115px;
            height: 23px;
            line-height: 23px;
            color: rgba(102, 102, 102, 1);
            font-size: 16px;
            text-align: center;
            font-family: Roboto;
        }
        .el-input--mini .el-input__inner {
            width: 202px;
        }
    }
    .el-icon-plus:before {
        color: #337aba;
        font-size: 20px;
        font-weight: 800;
        cursor: pointer;
    }
    .el-icon-minus:before {
        color: #e51c23;
        font-size: 20px;
        font-weight: 800;
        cursor: pointer;
    }
}
</style>

<template>
    <div id="cmain" class="family-tree-mask" v-loading="loading" element-loading-text="数据加载中，请稍等......">
        <div class="mainContent">
            <!--临床与治疗信息-->
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>临床与治疗信息</span>
                </div>
                <div class="text item">
                    <div class="mainContentLeft">
                        <el-form ref="form" :model="datas" label-width="140px" :label-position="labelPosition" size='mini'>
                            <el-form-item label="组织病理类型">
                                <el-select v-model="datas.pathology_type" placeholder="请选择">
                                    <el-option label="子宫内膜样腺癌" value="1"></el-option>
                                    <el-option label="浆液性腺癌" value="2"></el-option>
                                    <el-option label="透明细胞腺癌" value="3"></el-option>
                                    <el-option label="癌肉瘤" value="4"></el-option>
                                    <el-option label="未分化癌" value="5"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="FIGO分期">
                                <el-select v-model="datas.figo" placeholder="请选择" @change='getFigoMes'>
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="I期" value="1"></el-option>
                                    <el-option label="IA期" value="2"></el-option>
                                    <el-option label="IB期" value="3"></el-option>
                                    <el-option label="II期" value="4"></el-option>
                                    <el-option label="III期" value="5"></el-option>
                                    <el-option label="IIIA期" value="6"></el-option>
                                    <el-option label="IIIB期" value="7"></el-option>
                                    <el-option label="IIIC期" value="8"></el-option>
                                    <el-option label="IIIC1期" value="9"></el-option>
                                    <el-option label="IIIC2期" value="10"></el-option>
                                    <el-option label="IV期" value="11"></el-option>
                                    <el-option label="IVA期" value="12"></el-option>
                                    <el-option label="IVB期" value="13"></el-option>
                                </el-select>
                            </el-form-item>

                            <!-- <div>
                                {{datas.figoMes}}
                            </div> -->

                            <el-form-item label = ''>
                                <div>
                                {{datas.figoMes}}
                                 </div>
                            </el-form-item>

                            <el-form-item label="生育情况">
                                <el-select v-model="datas.fertility_circumst" placeholder="请选择">
                                    <el-option label="已生育" value="1"></el-option>
                                    <el-option label="未生育" value="2"></el-option>
                                    <el-option label="不孕不育" value="3"></el-option>
                                    <el-option label="选择不生育" value="4"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="初次生育年龄" v-if="datas.fertility_circumst == '1'">
                                <el-select v-model="datas.first_childbear_age" placeholder="请选择">
                                    <el-option label="<25岁" value="1"></el-option>
                                    <el-option label="25-30岁" value="2"></el-option>
                                    <el-option label="≥30岁" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="子女个数" v-if="datas.fertility_circumst == '1'">
                                <el-select v-model="datas.childbear_number" placeholder="请选择">
                                    <el-option label="1个" value="1"></el-option>
                                    <el-option label="2个" value="2"></el-option>
                                    <el-option label="＞2个" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="是否母乳喂养" v-if="datas.fertility_circumst == '1'">
                                <el-radio-group v-model="datas.breast_feeding">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="哺乳时间" v-if="datas.breast_feeding == '1' && datas.fertility_circumst == '1' ">
                                <el-select v-model="datas.nursing_time" placeholder="请选择">
                                    <el-option label="＜半年" value="1"></el-option>
                                    <el-option label="＜1年" value="2"></el-option>
                                    <el-option label="≥1年" value="3"></el-option>
                                </el-select>
                            </el-form-item>



                            <el-form-item label="是否绝经">
                                <el-radio-group v-model="datas.menopause">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            

                            <el-form-item label="绝经年龄" v-if="datas.menopause == '1'">
                                <el-select v-model="datas.menopause_age" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="≥55岁" value="1"></el-option>
                                    <el-option label="<55岁" value="2"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="初次月经年龄">
                                <el-select v-model="datas.primary_age" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="＜12岁" value="1"></el-option>
                                    <el-option label="≥12岁" value="2"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="手术">
                                <el-select v-model="datas.operation_type" placeholder="请选择">
                                    <el-option label="全子宫双附件切除术" value="1"></el-option>
                                    <el-option label="保留生育手术" value="2"></el-option>
                                    <el-option label="肿瘤细胞减灭术" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                            <!-- <el-form-item label="药物名称">
                                <el-input v-model="datas.immunotherapy_drug"></el-input>
                            </el-form-item> -->


                            <el-form-item label="错配修复缺陷检测">

                            </el-form-item>

                            <el-form-item label="MLH1">
                                <el-select v-model="datas.mhl1" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="未检测" value="1"></el-option>
                                    <el-option label="阳性" value="2"></el-option>
                                    <el-option label="阴性" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="MSH2">
                                <el-select v-model="datas.msh2" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="未检测" value="1"></el-option>
                                    <el-option label="阳性" value="2"></el-option>
                                    <el-option label="阴性" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="MSH6">
                                <el-select v-model="datas.msh6" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="未检测" value="1"></el-option>
                                    <el-option label="阳性" value="2"></el-option>
                                    <el-option label="阴性" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="PMS2">
                                <el-select v-model="datas.pms2" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="未检测" value="1"></el-option>
                                    <el-option label="阳性" value="2"></el-option>
                                    <el-option label="阴性" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="微卫星不稳定性（MSI）">
                                <el-select v-model="datas.msi" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="未检测" value="1"></el-option>
                                    <el-option label="MSI-L" value="2"></el-option>
                                    <el-option label="MSI-H" value="3"></el-option>
                                    <el-option label="MSS" value="4"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="BRAF V600E">
                                <el-select v-model="datas.braf" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="未检测" value="1"></el-option>
                                    <el-option label="阳性" value="2"></el-option>
                                    <el-option label="阴性" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="MLH1启动子甲基化检测">
                                <el-select v-model="datas.mlh1detect" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>                                    
                                    <el-option label="未检测" value="1"></el-option>
                                    <el-option label="阳性" value="2"></el-option>
                                    <el-option label="阴性" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                        </el-form>

                    </div>
                    <div class="mainContentRight">
                        <el-form ref="form" :model="datas" label-width="185px" :label-position="labelPosition" size='mini'>

                            <el-form-item label="是否进行过化疗">
                                <el-radio-group v-model="datas.chemotherapy">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>   
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否进行靶向治疗">
                                <el-radio-group v-model="datas.targeted_therapy">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否患有高血压">
                                <el-radio-group v-model="datas.hypertension">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否患有子宫内膜增生">
                                <el-radio-group v-model="datas.hyperplasia_endometrii">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否患有多囊卵巢综合征">
                                <el-radio-group v-model="datas.pcos">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否接受过盆腔放射治疗">
                                <el-radio-group v-model="datas.prt">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否有乳腺相关病史">
                                <el-radio-group v-model="datas.breast_history">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>  
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否有卵巢相关病史">
                                <el-radio-group v-model="datas.ovary_history">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否患有Ⅱ型糖尿病">
                                <el-radio-group v-model="datas.niddm">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否进行过激素替代治疗">
                                <el-radio-group v-model="datas.hrt">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="是否进行过免疫治疗">
                                <el-radio-group v-model="datas.immunotherapy">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="其它治疗">
                                <el-radio-group v-model="datas.other_treatment">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="具体信息" v-if="datas.other_treatment == '1'">
                                <el-input v-model="datas.other_treatment_name"></el-input>
                            </el-form-item>

                            <el-form-item label="是否进行过放疗">
                                <el-radio-group v-model="datas.radiotherapy">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                        </el-form>

                    </div>
                </div>
            </el-card>
            <!--遗传性肿瘤综合征表型信息-->
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>遗传性肿瘤综合征表型信息</span>
                </div>
                <div class="text item">
                    <div class="mainContentLeft">
                        <el-form ref="form" :model="datas" label-width="140px" :label-position="labelPosition" size='mini'>
                            <el-form-item label="患有黑斑性息肉">
                                <el-radio-group v-model="datas.blackspot_polyp">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="个数" v-if='datas.blackspot_polyp==1'>
                                <el-input v-model="datas.blackspot_number"></el-input>
                            </el-form-item>

                            <el-form-item label="胃肠道错构瘤/神经节瘤">
                                <el-radio-group v-model="datas.hamartoma">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="个数" v-if='datas.hamartoma==1'>
                                <el-input v-model="datas.hamartoma_number"></el-input>
                            </el-form-item>

                            <el-form-item label="食道糖原棘皮症">
                                <el-radio-group v-model="datas.glycogen_spines">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="个数" v-if='datas.glycogen_spines==1'>
                                <el-input v-model="datas.glycogen_spines_num"></el-input>
                            </el-form-item>

                            <el-form-item label="患有脂肪瘤">
                                <el-radio-group v-model="datas.lipomyoma">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="个数" v-if='datas.lipomyoma==1'>
                                <el-input v-model="datas.lipomyoma_number"></el-input>
                            </el-form-item>

                            <el-form-item label="皮肤黏膜病变">
                                <div>
                                    <el-checkbox v-model="datas.trichilemoma">毛鞘瘤</el-checkbox>
                                    <el-radio-group v-model="datas.trichilemoma_number" v-if='datas.trichilemoma==true'>
                                        <el-radio label="2">＜3个</el-radio>
                                        <el-radio label="1">≥3个</el-radio>
                                    </el-radio-group>

                                </div>
                                <div>
                                    <el-checkbox v-model="datas.acrokeratoderma">肢端角化</el-checkbox>
                                    <el-radio-group v-model="datas.acrokeratoderma_number" v-if='datas.acrokeratoderma==true'>
                                        <el-radio label="2">＜3个</el-radio>
                                        <el-radio label="1">≥3个</el-radio>
                                    </el-radio-group>
                                </div>
                                <div>
                                    <el-checkbox v-model="datas.mucocutaneous_neuromata">皮肤黏膜神经瘤</el-checkbox>
                                    <el-radio-group v-model="datas.mnn" v-if='datas.mucocutaneous_neuromata==true'>
                                        <el-radio label="2">＜3个</el-radio>
                                        <el-radio label="1">≥3个</el-radio>
                                    </el-radio-group>
                                </div>
                                <div>
                                    <el-checkbox v-model="datas.oral_papilloma">口腔乳头瘤</el-checkbox>
                                    <el-radio-group v-model="datas.oral_papilloma_num" v-if='datas.oral_papilloma==true'>
                                        <el-radio label="2">＜3个</el-radio>
                                        <el-radio label="1">≥3个</el-radio>
                                    </el-radio-group>
                                </div>

                            </el-form-item>

                        </el-form>

                    </div>

                    <div class="mainContentRight">
                        <el-form ref="form" :model="datas" label-width="140px" :label-position="labelPosition" size='mini'>
                            <el-form-item label="自闭症谱系障碍">
                                <el-radio-group v-model="datas.asd">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="成人 Lhermitte– Duclos病史">
                                <el-radio-group v-model="datas.lhermitte_duclos">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="皮肤黏膜色素沉着过度">
                                <el-radio-group v-model="datas.hyperpigmentation">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="黑斑性息肉病家族史">
                                <el-radio-group v-model="datas.blackspot_family_history">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="多发性甲状腺结节">
                                <el-radio-group v-model="datas.mng">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio> 
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="智力损伤（IQ≤75）">
                                <el-radio-group v-model="datas.intellectual_damage">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="血管异常（包括多发颅内静脉发育异常）">
                                <el-radio-group v-model="datas.vascular_anomaly">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="大头畸形">
                                <el-select v-model="datas.macrocephalia" placeholder="请选择">
                                    <el-option label="请选择" value="0"></el-option>
                                    <el-option label="<58cm" value="1"></el-option>
                                    <el-option label="58cm-60cm" value="2"></el-option>
                                    <el-option label=">60cm" value="3"></el-option>
                                </el-select>
                            </el-form-item>

                        </el-form>
                    </div>
                </div>

            </el-card>
            <!--基因检测信息-->
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>基因检测信息</span>
                </div>
                <div class="text item gene-item">
                    <template>
                        <el-table
                            type=index
                            :data="datas.results"
                            border
                            style="width: 100%">

                            <el-table-column
                            fixed="left"
                            label="操作">
                            <template slot-scope="scope">
                                <i class="el-icon-plus" @click="addGen(scope.$index)"></i>
                                <i class="el-icon-minus" @click="removeGen(scope.$index)"></i>
                            </template>
                            </el-table-column>

                            <el-table-column
                            fixed
                            contentEditable
                            prop="detection_result_gene"
                            width="240"
                            label="基因">
                            <template slot-scope="scope">
                                <el-input  v-model="scope.row.detection_result_gene" placeholder="只能输入大写字母和数字"></el-input>
                            </template>
                            </el-table-column>

                            <el-table-column
                            prop="detection_result_trans"
                            width="240"
                            label="转录本号">
                            <template slot-scope="scope">
                                <el-input  v-model="scope.row.detection_result_trans" placeholder="请输入转录本号"></el-input>
                            </template>
                            </el-table-column>

                            <el-table-column
                            prop="detection_result_varia"
                            width="240"
                            label="变异位点">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.detection_result_varia" placeholder="请输入变异位点"></el-input>
                            </template>
                            </el-table-column>

                            <el-table-column
                            label="检测类型">
                            <template slot-scope="scope">
                                    <el-select v-model="scope.row.assay_type" placeholder="请选择">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option label="全基因组" value="1"></el-option>
                                        <el-option label="全外显子检测" value="2"></el-option>
                                        <el-option label="panel检测" value="3"></el-option>
                                        <el-option label="sanger测序" value="4"></el-option>
                                        <el-option label="MLPA" value="5"></el-option>

                                    </el-select>                             
                            </template>
                            </el-table-column>

                            <el-table-column
                            label="功能改变">
                            <template slot-scope="scope">
                               
                                    <el-select v-model="scope.row.functional_change" placeholder="请选择" v-if='scope.row.functional_change!="6"'>
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option label="错义突变" value="1"></el-option>
                                        <el-option label="无义突变" value="2"></el-option>
                                        <el-option label="移码突变" value="3"></el-option>
                                        <el-option label="同义突变" value="4"></el-option>
                                        <el-option label="剪接位点突变" value="5"></el-option>
                                        <el-option label="其他" value="6"></el-option>

                                    </el-select>
                                    <div v-else>
                                        <el-input size="mini" v-model="scope.row.other_function_change"></el-input>
                                        <i class="el-icon-error" @click="goBackSelect(scope.row)"></i>
                                    </div>
                                    
                                    
                               
                            </template>
                            </el-table-column>

                            <el-table-column
                            label="突变类型">
                            <template slot-scope="scope">
                               
                                    <el-select v-model="scope.row.mutation_type" placeholder="请选择">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option label="致病的" value="1"></el-option>
                                        <el-option label="可能致病的" value="2"></el-option>
                                        <el-option label="意义不明确的" value="3"></el-option>
                                        <el-option label="可能良性的" value="4"></el-option>
                                        <el-option label="良性的" value="5"></el-option>

                                    </el-select>
                               
                            </template>
                            </el-table-column>
                            
                            
                        </el-table>
                    </template>



                </div>
            </el-card>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>生活方式</span>
                </div>
                <div class="text item">
                    <div class="mainContentLeft">
                        <el-form ref="form" :model="datas" label-width="140px" :label-position="labelPosition" size='mini'>
                            <el-form-item label="吸烟">
                                <el-radio-group v-model="datas.smoking">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>
                            <el-form-item label="" v-if='datas.smoking==1' label-width="200px">
                                <el-input size="small" v-model="datas.smoking_cycle" style='width:50px'></el-input> &nbsp;&nbsp;包/周&nbsp;X&nbsp;
                                <el-input size="small" v-model="datas.smoking_year" style='width:50px'></el-input> &nbsp;&nbsp;年
                            </el-form-item>

                            <el-form-item label="饮酒">
                                <el-radio-group v-model="datas.drink">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                            <el-form-item label="" v-if='datas.drink==1' label-width="200px">
                                <el-input size="small" v-model="datas.drink_cycle" style='width:50px'></el-input> &nbsp;&nbsp;次/周
                            </el-form-item>

                            <el-form-item label="高脂高红肉类饮食">
                                <el-radio-group v-model="datas.fatty_meat">
                                    <el-radio label="1">是</el-radio>
                                    <el-radio label="2">否</el-radio>
                                </el-radio-group>
                            </el-form-item>

                        </el-form>
                    </div>
                    <div class="mainContentRight">
                        <el-form ref="form" :model="datas" label-width="140px" :label-position="labelPosition" size='mini'>
                            <el-form-item label="每日蔬菜摄入量">
                                <el-select v-model="datas.vegetable_consum" placeholder="请选择">
                                    <el-option label="≥500mg" value="1"></el-option>
                                    <el-option label="＜500mg" value="2"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="每日运动消耗量">
                                <el-select v-model="datas.dec" placeholder="请选择">
                                    <el-option label="基本无运动量" value="1"></el-option>
                                    <el-option label="30-50大卡" value="2"></el-option>
                                    <el-option label="50-100大卡" value="3"></el-option>
                                    <el-option label="100-200大卡" value="4"></el-option>
                                    <el-option label="200-300大卡" value="5"></el-option>
                                    <el-option label="＞300大卡" value="6"></el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="体重（kg）">
                                <el-input v-model="datas.weight" @change="getBmi"></el-input>
                            </el-form-item>

                            <el-form-item label="身高（cm）">
                                <el-input v-model="datas.height" @change="getBmi"></el-input>
                            </el-form-item>

                            <el-form-item label="BMI">
                               <!-- <el-input v-model="datas.bmi" readonly='readonly'></el-input> -->
                                 <div>
                                     {{datas.bmi}}
                                 </div>
                            </el-form-item>

                        </el-form>
                    </div>
                </div>

            </el-card>
            <el-card class="box-card footer-card">
                <div slot="header">
                    <Button  style="float: right; margin-left:20px;" @click="onClose">取消</Button>
                    <Button type="primary" style="float: right;" @click="save">保存</Button>    
                </div>
            </el-card>
        </div>
    </div>
</template>
<script>
import { setCookie, getCookie, delCookie } from "@/common/js/cookie.js";
import { familyTree } from "../../../api/basic/familyTree/familyTree.js";
export default {
    name: "zgnma", //子宫内膜癌
    data() {
        return {
            labelPosition: "left", //表单对齐方式
            loading:false,
            obj: {
                a: "1",
                b: "2"
            },
            sendObj:{
                cancerId:"",
                familyTreeId:"",
                userId : getCookie("userid"),
                familyUserId:""
            },
            datas: {
                pathology_type: "",
                figo: "",
                figoMes:'',
                figo_result: "",
                mhl1: "",
                msh2: "",
                msh6: "",
                pms2: "",
                msi: "",
                braf: "",
                mlh1detect: "",
                fertility_circumst: "",
                first_childbear_age: "",
                childbear_number:'',
                children_number: "",
                breast_feeding: "2",
                nursing_time: "",
                primary_age: "",
                menopause: "2",
                menopause_age: "",
                breast_history: "2",
                ovary_history: "2",
                hrt: "2",
                immunotherapy: "2",
                immunotherapy_drug: "",
                other_treatment: "2",
                other_treatment_name: "",
                niddm: "2",
                hypertension: "2",
                hyperplasia_endometrii: "2",
                pcos: "2",
                prt: "2",
                operation_type: "",
                chemotherapy: "2",
                radiotherapy: "2",
                targeted_therapy: "2",
                blackspot_polyp: "2",
                blackspot_number: "",
                hyperpigmentation: "2",
                blackspot_family_history: "2",
                lhermitte_duclos: "2",
                hamartoma: "2",
                hamartoma_number: "",
                macrocephalia: "",
                trichilemoma: false,
                trichilemoma_number: "2",
                acrokeratoderma: false,
                acrokeratoderma_number: "2",
                mucocutaneous_neuromata: false,
                mnn: "2",
                oral_papilloma: false,
                oral_papilloma_num: "2",
                asd: "2",
                glycogen_spines: "2",
                glycogen_spines_num: "",
                lipomyoma: "2",
                lipomyoma_number: "",
                intellectual_damage: "2",
                vascular_anomaly: "2",
                mng: "2",
                msg: "消息",
                results: [
                    {
                        assay_type: "",
                        detection_result_gene: "",
                        detection_result_trans: "",
                        detection_result_varia: "",
                        functional_change: "",
                        other_function_change: "",
                        mutation_type: ""
                    }
                ],
                smoking: "2",
                drink: "2",
                vegetable_consum: "",
                fatty_meat: "2",
                dec: "",
                drink_cycle: "",
                bmi: "",
                height: "",
                weight: "",
                smoking_cycle: "",
                smoking_year: ""
            }
        };
    },
    components: {},
    created() {},
    methods: {
        onClose() {
            window.close();
        },
        //功能改变
        goBackSelect(row) {
            row.functional_change = "";
        },
        addGen(row) {
            let obj = {
                assay_type: "",
                detection_result_gene: "",
                detection_result_trans: "",
                detection_result_varia: "",
                functional_change: "",
                other_function_change: "",
                mutation_type: ""
            };
            ++row;
            this.datas.results.splice(row, 0, obj);
        },
        removeGen(row) {
            if (this.datas.results.length <= 1) {
                this.$Message.info("最少为一条，不可删除了");
                return;
            }
            this.datas.results.splice(row, 1);
        },
        tableRowClassName(row, index) {
            row.index = index;
        },
        save() {
            let saveObj = {
                cancerId: this.sendObj.cancerId,
                familyTreeId: this.sendObj.familyTreeId,
                userId: this.sendObj.userId,
                familyUserId: this.sendObj.familyUserId,
                familyCancer: this.datas
            };
            this.loading = true;
            familyTree.saveOrUpdateCancerForm(saveObj).then(res => {
                if (res.returnCode == 0 || res.returnCode == 200) {
                    this.$Message.success("保存" + res.msg);
                } else {
                    this.$Message.error(res.msg);
                }
                this.loading = false;
            }).catch(error => {
                this.loading = false;
            });
        },
        getBmi() {
            let bmi =
                Math.round(
                    this.datas.weight /
                        Math.pow(this.datas.height / 100, 2) *
                        100
                ) / 100;
            if (isNaN(bmi) || bmi == Infinity) {
                this.datas.bmi = "";
            } else {
                this.datas.bmi = bmi;
            }
        },
        getFigoMes() {
            if(this.datas.figo == '1'){
                this.datas.figoMes = 'I期:肿瘤局限于子宫体'
            }else if(this.datas.figo == '2'){
                this.datas.figoMes = 'IA期:肿瘤无浸润或浸润肌层＜1/2'
            }else if(this.datas.figo == '3'){
                this.datas.figoMes = 'IB期:肿瘤浸润肌层≥1/2'
            }else if(this.datas.figo == '4'){
                this.datas.figoMes = '4II期:肿瘤侵犯宫颈间质，但无宫体外蔓延'
            }else if(this.datas.figo == '5'){
                this.datas.figoMes = '5III期:肿瘤局部和／或区域扩散'
            }else if(this.datas.figo == '6'){
                this.datas.figoMes = '6IIIA期:肿瘤累及浆膜层和／或附件'
            }else if(this.datas.figo == '7'){
                this.datas.figoMes = '7IIIB期:阴道和／或宫旁受累'
            }else if(this.datas.figo == '8'){
                this.datas.figoMes = '8IIIC期:盆腔淋巴结和／或腹主动脉旁淋巴结转移'
            }else if(this.datas.figo == '9'){
                this.datas.figoMes = '9IIIC1期:盆腔淋巴结阳性'
            }else if(this.datas.figo == '10'){
                this.datas.figoMes = '10IIIC2期:腹主动脉伴淋巴结阳性和／或盆腔淋巴结阳性'
            }else if(this.datas.figo == '11'){
                this.datas.figoMes = '11IV期:肿瘤侵及膀胱和（或）直肠黏膜，和（或）远处转移'
            }else if(this.datas.figo == '12'){
                this.datas.figoMes = '12IVA期:肿瘤侵及膀胱或直肠黏膜'
            }else if(this.datas.figo == '13'){
                this.datas.figoMes = '13IVB期:远处转移，包括腹腔内和（或）腹股沟淋巴结转移'
            }else {
                this.datas.figoMes = ''
            }
        },
        getOneById() {
            let obj = M.url();
            this.sendObj.cancerId = obj.cancerId;
            this.sendObj.familyTreeId = obj.familyTreeId;
            this.sendObj.userId = getCookie("userid");
            this.sendObj.familyUserId = obj.current_personid;
        }
    },
    mounted() {
        document.title = "子宫内膜癌辅助信息";
        this.getOneById();
        this.getBmi();
        this.loading = true;
        familyTree.findOneFromCancer(this.sendObj).then(res => {
            console.log(res);
            if (res.returnCode == 0 || res.returnCode == 200) {
                if (res.data && res.data.familyCancer) {
                    this.datas = res.data.familyCancer;
                }
            } else {
                this.$Message.error(res.msg);
            }
            this.loading = false;
        }).catch(error => {
            this.loading = false;
        })
    }
};
</script>
